﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace FastExecutor.Base.Model
{
    public class Tree
    {
        public string id { set; get; }
        public string label { set; get; }
        public string paerntGuid{ set; get; }
        public List<Tree> children { set; get; }
        public bool hasChildren { set; get; }
        public bool hasParent { set; get; }

        public Dictionary<string, object> arttibutes { set; get; }

        public Tree()
        {
            hasChildren = false;
            hasParent = false;
            arttibutes = new Dictionary<string, object>();
        }

        public void AddAtttibute(string key,object value)
        {
            if (!arttibutes.ContainsKey(key))
            {
                arttibutes.Add(key, value);
            }
            else
            {
                arttibutes[key] = value;
            }
        }
    }
}
